﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OOP
{
    class Program
    {
        static void Main(string[] args)
        {
            Shape s1 = new Circle(); //Explicit
            Shape c = new Cube(); //Explicit

            var areaOfTheCircle = s1.GetArea(20); //Implicit
            var areaOfTheCube = c.GetArea(5, 10, 15);
    
            Console.WriteLine("The area of the circle is {0}", areaOfTheCircle);
            Console.WriteLine("The area of the cube is {0}", areaOfTheCube);
            
            var valueOfTheStaticMethod = SomethingAwesome.GiveMeANumber();
            Console.WriteLine("The magic number is " + valueOfTheStaticMethod);

            Console.ReadLine();
        }

        private int giveMeANumber()
        {
            return 1;
        }
    }

    public abstract class Shape
    {
        //protected
        public abstract double GetArea(double f1, double? f2 = null, double? f3 = null);
        
        

        //internal
        //internal protected
    }

    public static class SomethingAwesome
    {
        public static int GiveMeANumber()
        {
            return 42;
        }
    }
    public class Circle : Shape
    {
        public override double GetArea(double r, double? f2 = null, double? f3 = null)
        {
            return Math.PI * Math.Pow(r, 2);
        }  
    }

    public class Cube : Shape
    {
        public override double GetArea(double length, double? width = null, double? height = null)
        {
            return length * width.Value * height.Value;
        }
    }
}
